<template>
  <div class="body">
      <el-form
          class="elform"
          ref="information"
          :model="information">
        <table class="table">
          <colgroup style="width: 100%">
            <col width="110">
<!--            <col width="120">-->
<!--            <col width="140">-->
<!--            <col width="150">-->
<!--            <col width="150">-->
<!--            <col width="100">-->
<!--            <col width="150">-->
          </colgroup>
          <thead>
          <tr>
            <th>姓名</th>
            <th><el-input
                    required
                v-model="this.information.name"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px;"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
              <th>曾用名</th>
              <th><el-input
                      v-model="this.information.formerName"
                      resize=none
                      autosize
                      class="areaInputStyle"
                      style="font-family: 仿宋;font-size: 14px;"
                      type="textarea" ref="inputRef6"
              >
              </el-input></th>
            <th>姓名拼音</th>
            <th>
              <el-input
                  required
                  v-model="this.information.namePinyin"
                  resize=none
                  autosize
                  class="areaInputStyle"
                  style="font-family: 仿宋;font-size: 14px;"
                  type="textarea" ref="inputRef6"
              >
              </el-input>
            </th>
            <!--                <th>{{ this.information.name }}</th>-->

          </tr>
          <tr>
              <th>性别</th>
              <th><el-select
                      v-model="this.information.sex"
                      placeholder="请选择性别"
                      class="add-nation-input"
              >
                  <el-option
                          v-for="item in this.sex"
                          :key="item.value"
                          :label="item.info"
                          :value="item.value"
                  ></el-option>
              </el-select></th>
              <th>民族</th>
              <th>
                  <el-select
                          v-model="this.information.thnic"
                          filterable
                          placeholder="请选择民族"
                          class="add-nation-input"
                  >
                      <el-option
                              v-for="item in nationList"
                              :key="item.value"
                              :label="item.info"
                              :value="item.value"
                      ></el-option>
                  </el-select>
              </th>
            <th>出生日期</th>
            <th>
              <el-date-picker
                  v-model="information.birthdate"
                  style="width: 100%"
                  value-format="YYYY-MM-DD"
                  type="date"
                  placeholder="日期"
                  clearable
              />
            </th>

          </tr>
          <tr>
              <th>年级</th>
              <th><el-select
                  v-model="this.information.gradeNo"
                      filterable
                      placeholder="请选择年级"
                      class="add-nation-input"
              >
                  <el-option
                          v-for="key in this.grade"
                          :key="key.value"
                          :label="key.text"
                          :value="key.value"
                  ></el-option>
              </el-select></th>
            <th>班级</th>
            <th>
              <el-cascader
                  v-model="this.information.classNo"
                  :options="allClassNo"
                  :show-all-levels="false"
                  placement="right-start"
                  :props="{ expandTrigger: 'hover' }"
                  @change="selectedClassChanged"
                  placeholder="请选择班级"
                  filterable
                  class="flex-item"
              ></el-cascader>
            </th>
            <!--              <th>学号</th>-->
            <!--              <th><el-input-->
            <!--                      v-model="this.information.accountNo"-->
            <!--                      resize=none-->
            <!--                      autosize-->
            <!--                      class="areaInputStyle"-->
            <!--                      style="font-family: 仿宋;font-size: 14px"-->
            <!--                      type="textarea" ref="inputRef6"-->
            <!--              >-->
            <!--              </el-input></th>-->
          </tr>
          <tr>
              <th>学制</th>
              <th>
                  <el-select v-model="this.information.educationalSystem" placeholder="请选择">
                      <el-option
                              v-for="key in options"
                              :key="key.label"
                              :label="key.label"
                              :value="key.value">
                      </el-option>
                  </el-select></th>
            <!--              <th>学院</th>-->
            <!--              <th><el-input-->
            <!--                  v-model="this.information.departmentNo"-->
            <!--                      resize=none-->
            <!--                      autosize-->
            <!--                      class="areaInputStyle"-->
            <!--                      style="font-family: 仿宋;font-size: 14px"-->
            <!--                      type="textarea" ref="inputRef6"-->
            <!--              >-->
            <!--              </el-input></th>-->
            <th>专业名称</th>
            <th><el-select
                v-model="this.information.majorNo"
                filterable
                placeholder="请选择专业"
                class="add-nation-input"
            >
              <el-option
                  v-for="key in this.major"
                  :key="key.value"
                  :label="key.text"
                  :value="key.value"
              ></el-option>
            </el-select></th>

<!--            <th>班级简称</th>-->
<!--            <th><el-input-->
<!--                v-model="this.information.classShortName"-->
<!--                resize=none-->
<!--                autosize-->
<!--                class="areaInputStyle"-->
<!--                style="font-family: 仿宋;font-size: 14px"-->
<!--                type="textarea" ref="inputRef6"-->
<!--            >-->
<!--            </el-input></th>-->
          </tr>
          <tr>

            <th>手机号码</th>
            <th><el-input
                v-model="this.information.contact"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
              <th>电子邮箱</th>
              <th><el-input
                      v-model="this.information.email"
                      resize=none
                      autosize
                      class="areaInputStyle"
                      style="font-family: 仿宋;font-size: 14px"
                      type="textarea" ref="inputRef6"
              >
              </el-input></th>
              <th>QQ号码</th>
              <th><el-input
                      v-model="this.information.qq"
                      resize=none
                      autosize
                      class="areaInputStyle"
                      style="font-family: 仿宋;font-size: 14px"
                      type="textarea" ref="inputRef6"
              >
              </el-input></th>


          </tr>
          <tr>
            <th>证件号</th>
            <th><el-input
                v-model="this.information.idnumber"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
            <th>家庭地址</th>
            <th>
              <el-cascader
                  v-if="this.information.addressOfHousehold===null"
                  v-model="this.information.addressOfHousehold"
                  style="width: 100%"
                  :options="regionData"
                  @change="addressOfHouseholdChange"
                  placeholder="请选择地区"
              ></el-cascader>
              <el-input @click="this.addressOfHouseholdDialog()" v-if="this.information.addressOfHousehold!==null" v-model="this.information.addressOfHousehold"/>
            </th>
            <th id="addressDetail" colspan="2">
              <el-input
                  v-model="addressDetail"
                  resize=none
                  :key="1"
                  autosize
                  placeholder="请继续输入详细地址"
                  style="font-family: 仿宋;font-size: 14px"
                  type="textarea"
                  @click="this.addressDetial()"
              />
            </th>
          </tr>
          <tr>
              <th>学生类别</th>
              <th>
                  <el-select
                          v-model="this.information.studentCategory"
                          filterable
                          placeholder="请选择学生类别"
                          class="add-nation-input"
                  >
                      <el-option
                              v-for="item in studentCategory"
                              :key="item.value"
                              :label="item.info"
                              :value="item.value"
                      ></el-option>
                  </el-select>
              </th>
              <th>入学日期</th>
              <th>
                  <el-date-picker
                          v-model="this.information.enrollmentDate"
                          style="width: 100%"
                          value-format="YYYY-MM-DD"
                          type="date"
                          placeholder="日期"
                          clearable
                  />
                  <!--            </el-input>-->
              </th>
              <th>入学方式</th>
              <th>
                  <el-select v-model="this.information.admissionMethod" placeholder="请选择">
                      <el-option
                              v-for="key in admissionMethodOptions"
                              :key="key.label"
                              :label="key.label"
                              :value="key.value">
                      </el-option>
                  </el-select>
              </th>
              <th>籍贯</th>
              <th>
                  <el-cascader
                          v-if="this.information.nativePlaceProvince===null"
                          v-model="this.nativePlace"
                          :options="regionData"
                          @change="selectRegion"
                          placeholder="请选择籍贯"
                  ></el-cascader>
                  <el-input @click="this.information.nativePlaceProvince=null" v-if="this.information.nativePlaceProvince!==null" v-model="this.nativePlace"/>
              </th>

          </tr>
          <tr>
            <th>政治面貌</th>
            <th><el-select
                v-model="this.information.constructionPolstatusNo"
                    filterable
                    placeholder="请选择政治面貌"
                    class="add-nation-input"
            >
                <el-option
                        v-for="key in this.polstatus"
                        :key="key.polstatusName"
                        :label="key.polstatusName"
                        :value="key.polstatusNo"
                ></el-option>
            </el-select></th>
          <th v-if="this.information.constructionPolstatusNo!=='13'">政治面貌加入时间(具体到月)</th>
          <th v-if="this.information.constructionPolstatusNo!=='13'">
            <el-date-picker
                    v-model="this.information.joinTime"
                    style="width: 100%"
                    value-format="YYYY-MM"
                    type="date"
                    placeholder="政治面貌加入时间日期(群众跳过)，涉及入党条件请认真填写"
                    clearable
            />
          </th>
<!--            <th v-if="this.information.constructionPolstatusNo!=='13'">职务</th>-->
<!--            <th v-if="this.information.constructionPolstatusNo!=='13'">-->
<!--              <el-input-->
<!--                  v-model="this.information.duty"-->
<!--                  resize=none-->
<!--                  autosize-->
<!--                  class="areaInputStyle"-->
<!--                  style="font-family: 仿宋;font-size: 14px"-->
<!--                  type="textarea" ref="inputRef6"-->
<!--              >-->
<!--              </el-input>-->
<!--            </th>-->
            <th v-if="this.information.constructionPolstatusNo!=='13'">是否在本组织</th>
            <th v-if="this.information.constructionPolstatusNo!=='13'">
              <el-select
                  v-model="this.information.whetherIn"
                  filterable
                  placeholder="请选择"
                  class="add-nation-input"
              >
                <el-option
                    v-for="item in yesOrNo"
                    :key="item.value"
                    :label="item.value"
                    :value="item.value"
                ></el-option>
              </el-select>
            </th>
          </tr>
          <tr>
              <th>是否在校</th>
              <th><el-input
                      v-model="this.information.isInSchool"
                      resize=none
                      autosize
                      class="areaInputStyle"
                      style="font-family: 仿宋;font-size: 14px"
                      type="textarea" ref="inputRef6"
              >
              </el-input></th>
            <th>宿舍楼栋</th>
            <th>
              <el-select
                  v-model="this.information.dormitoryBuilding"
                  filterable
                  placeholder="请选择宿舍楼栋"
                  class="add-nation-input"
              >
                <el-option
                    v-for="item in dormitoryBuilding"
                    :key="item.value"
                    :label="item.info"
                    :value="item.value"
                ></el-option>
              </el-select>
            </th>
            <th>寝室号</th>
            <th>
              <el-input
                  v-model="this.information.dormitoryNumber"
                  resize=none
                  autosize
                  class="areaInputStyle"
                  style="font-family: 仿宋;font-size: 14px"
                  type="textarea" ref="inputRef6"
              >
              </el-input>
            </th>
            <th>外语类别</th>
            <th><el-input
                v-model="this.information.foreignLanguage"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                placeholder="类似英语、日语、德语等"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
          </tr>
          <tr>
            <th>身高</th>
            <th><el-input
                v-model="this.information.height"
                resize=none
                autosize
                placeholder="厘米(cm) 输入纯数字"
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
            <th>体重</th>
            <th><el-input
                placeholder="千克(kg) 输入纯数字"
                v-model="this.information.weight"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
<!--              <th>国测成绩</th>-->
<!--              <th><el-input-->
<!--                      v-model="this.information.sportGrade"-->
<!--                      resize=none-->
<!--                      autosize-->
<!--                      class="areaInputStyle"-->
<!--                      style="font-family: 仿宋;font-size: 14px"-->
<!--                      type="textarea" ref="inputRef6"-->
<!--              >-->
<!--              </el-input></th>-->
            <th>备注</th>
            <th><el-input
                v-model="this.information.notes"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
          </tr>
          <tr>
            <th>监护人1姓名</th>
            <th><el-input
                v-model="this.information.guardian1"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
            <th>监护人1联系方式</th>
            <th><el-input
                v-model="this.information.guardian1Contact"
                resize=none
                autosize
                class="areaInputStyle"
                style="font-family: 仿宋;font-size: 14px"
                type="textarea" ref="inputRef6"
            >
            </el-input></th>
<!--            <th>监护人1证件号码</th>-->
<!--            <th><el-input-->
<!--                v-model="this.information.guardian1Id"-->
<!--                resize=none-->
<!--                autosize-->
<!--                class="areaInputStyle"-->
<!--                style="font-family: 仿宋;font-size: 14px"-->
<!--                type="textarea" ref="inputRef6"-->
<!--            >-->
<!--            </el-input></th>-->
              <th>监护人2姓名</th>
              <th><el-input
                      v-model="this.information.guardian2"
                      resize=none
                      autosize
                      class="areaInputStyle"
                      style="font-family: 仿宋;font-size: 14px"
                      type="textarea" ref="inputRef6"
              >
              </el-input></th>
              <th>监护人2联系方式</th>
              <th><el-input
                      v-model="this.information.guardian2Contact"
                      resize=none
                      autosize
                      class="areaInputStyle"
                      style="font-family: 仿宋;font-size: 14px"
                      type="textarea" ref="inputRef6"
              >
              </el-input></th>
              <!--            <th>监护人2证件号码</th>-->
              <!--            <th><el-input-->
              <!--                v-model="this.information.guardian2Id"-->
              <!--                resize=none-->
              <!--                autosize-->
              <!--                class="areaInputStyle"-->
              <!--                style="font-family: 仿宋;font-size: 14px"-->
              <!--                type="textarea" ref="inputRef6"-->
              <!--            >-->
              <!--            </el-input></th>-->
          </tr>
          <tr>


          </tr>
          </thead>
        </table>
      </el-form>
    <el-form-item>
      <el-button type="primary" @click="upload('information');">提交</el-button>
      <el-button @click="goBack;getOneMassage()">取消</el-button>
    </el-form-item>
  </div>
  <el-dialog
      v-model="detailedInformation"
      :close-on-click-modal="false"
      title="学生详细信息"
      width="850px">
    <information v-if="detailedInformation" ref="dialog"/>
  </el-dialog>
</template>

<script>
import request from "@/util/request.js";
import {pcaTextArr, codeToText} from "element-china-area-data";
import {ElMessageBox} from "element-plus";
import router from "@/router/index.js";
import Information from "@/template/Information.vue";
export default {
  components: {Information},
  data() {
    return {
      detailedInformation: false,// 个人信息弹窗
      grade:[], //年级
      allClassNo: [],//班级
      major:[], // 专业
      id: "",
      nativePlace:"",//籍贯
      thnic: [],
      information: {},
      yesOrNo:[{
        value: '是'
      }, {
        value: '否'
      }],
      dormitoryBuilding: [{
        label: '6号楼',
        value: '6号楼'
      }, {
        label: '9号楼',
        value: '9号楼'
      }, {
        label: '文瀚苑',
        value: '文瀚苑'
      }, {
        label: '文泽苑',
        value: '文泽苑'
      }, {
        label: '文瀛苑',
        value: '文瀛苑'
      }, {
        label: '文鸿苑',
        value: '文鸿苑'
      }, {
        label: '文涛苑',
        value: '文涛苑'
      }, {
        label: '文澜苑',
        value: '文澜苑'
      }, {
        label: '文灏苑',
        value: '文灏苑'
      }, {
        label: '其他',
        value: '其他'
      }],
      admissionMethodOptions: [{
        value: '统招入学',
        label: '统招入学'
      }, {
        value: '对口升学',
        label: '对口升学'
      }, {
        value: '专升本',
        label: '专升本'
      }, {
        value: '其他',
        label: '其他'
      }],
      studentCategory: [
        {
          info: '专升本',
          value: '专升本'
        },
        {
          info: '对口升学',
          value: '对口升学'
        },
        {
          info: '普通本科',
          value: '普通本科'
        },

      ],
      polstatus: [],
      options: [{
        value: '2年',
        label: '2年'
      }, {
        value: '4年',
        label: '4年'
      }, {
        value: '5年',
        label: '5年'
      }],
      sex:[
        {
            id: 1,
            info: '女',
            value: '女'
        },
          {
              id: 1,
              info: '男',
              value: '男'
          }

      ],
      nationList: [
        {
          id: 1,
          info: '汉族',
          value: '汉族'
        },
        {
          id: 2,
          info: '壮族',
          value: '壮族'
        },
        {
          id: 3,
          info: '满族',
          value: '满族'
        },
        {
          id: 4,
          info: '回族',
          value: '回族'
        },
        {
          id: 5,
          info: '苗族',
          value: '苗族'
        },
        {
          id: 6,
          info: '维吾尔族',
          value: '维吾尔族'
        },
        {
          id: 7,
          info: '土家族',
          value: '土家族'
        },
        {
          id: 8,
          info: '彝族',
          value: '彝族'
        },
        {
          id: 9,
          info: '蒙古族',
          value: 9
        },
        {
          id: 10,
          info: '藏族',
          value: '藏族'
        },
        {
          id: 11,
          info: '布依族',
          value: '布依族'
        },
        {
          id: 12,
          info: '侗族',
          value: '侗族'
        },
        {
          id: 13,
          info: '瑶族',
          value: '瑶族'
        },
        {
          id: 14,
          info: '朝鲜族',
          value: '朝鲜族'
        },
        {
          id: 15,
          info: '白族',
          value: '白族'
        },
        {
          id: 16,
          info: '哈尼族',
          value: '哈尼族'
        },
        {
          id: 17,
          info: '哈萨克族',
          value: '哈萨克族'
        },
        {
          id: 18,
          info: '黎族',
          value: '黎族'
        },
        {
          id: 19,
          info: '傣族',
          value: '傣族'
        },
        {
          id: 20,
          info: '畲族',
          value: '畲族'
        },
        {
          id: 21,
          info: '傈僳族',
          value: '傈僳族'
        },
        {
          id: 22,
          info: '仡佬族',
          value: '仡佬族'
        },
        {
          id: 23,
          info: '东乡族',
          value: '东乡族'
        },
        {
          id: 24,
          info: '高山族',
          value: '高山族'
        },
        {
          id: 25,
          info: '拉祜族',
          value: '拉祜族'
        },
        {
          id: 26,
          info: '水族',
          value: '水族'
        },
        {
          id: 27,
          info: '佤族',
          value: '佤族'
        },
        {
          id: 28,
          info: '纳西族',
          value: '纳西族'
        },
        {
          id: 29,
          info: '羌族',
          value: '羌族'
        },
        {
          id: 30,
          info: '土族',
          value: '土族'
        },
        {
          id: 31,
          info: '仫佬族',
          value: '仫佬族'
        },
        {
          id: 32,
          info: '锡伯族',
          value: '锡伯族'
        },
        {
          id: 33,
          info: '柯尔克孜族',
          value: '柯尔克孜族'
        },
        {
          id: 34,
          info: '达斡尔族',
          value: '达斡尔族'
        },
        {
          id: 35,
          info: '景颇族',
          value: '景颇族'
        },
        {
          id: 36,
          info: '毛南族',
          value: '毛南族'
        },
        {
          id: 37,
          info: '撒拉族',
          value: '撒拉族'
        },
        {
          id: 38,
          info: '布朗族',
          value: '布朗族'
        },
        {
          id: 39,
          info: '塔吉克族',
          value: '塔吉克族'
        },
        {
          id: 40,
          info: '阿昌族',
          value: '阿昌族'
        },
        {
          id: 41,
          info: '普米族',
          value: '普米族'
        },
        {
          id: 42,
          info: '鄂温克族',
          value: '鄂温克族'
        },
        {
          id: 43,
          info: '怒族',
          value: '怒族'
        },
        {
          id: 44,
          info: '京族',
          value: '京族'
        },
        {
          id: 45,
          info: '基诺族',
          value: '基诺族'
        },
        {
          id: 46,
          info: '德昂族',
          value: '德昂族'
        },
        {
          id: 47,
          info: '保安族',
          value: '保安族'
        },
        {
          id: 48,
          info: '俄罗斯族',
          value: '俄罗斯族'
        },
        {
          id: 49,
          info: '裕固族',
          value: '裕固族'
        },
        {
          id: 50,
          info: '乌孜别克族',
          value: '乌孜别克族'
        },
        {
          id: 51,
          info: '门巴族',
          value: '门巴族'
        },
        {
          id: 52,
          info: '鄂伦春族',
          value: '鄂伦春族'
        },
        {
          id: 53,
          info: '独龙族',
          value: '独龙族'
        },
        {
          id: 54,
          info: '塔塔尔族',
          value: '塔塔尔族'
        },
        {
          id: 55,
          info: '赫哲族',
          value: '赫哲族'
        },
        {
          id: 56,
          info: '珞巴族',
          value: '珞巴族'
        }
      ],
      selectedOptions: [],
      regionData: pcaTextArr,
      addressDetail: ""
    }
  },
  created() {
    // this.$notify({
    //   title: '更新个人信息BUG',
    //   message: '收到BUG反馈，更新个人信息有问题，大家先不要更新，正在排查',
    //   duration: 0
    // });
    this.accountNo = JSON.parse(localStorage.getItem('user')).accountNo
    if (router.currentRoute.value.query.accountNo !== undefined) {
      this.getOneMassage(router.currentRoute.value.query.accountNo)
    } else {
      this.getOneMassage()
    }
    this.getClass()
    this.getGrade()
    this.getMajor()
    this.getPolstatus()
  },
  methods: {
    // 选择班级改变
    selectedClassChanged() {
      console.log(this.information.classNo)
      this.information.classNo = this.information.classNo[2]
      console.log(this.information.classNo)
    },
    upload(val) {
      this.$refs[val].validate((valid) => {
        if (valid) {
          this.information.addressOfHousehold = this.information.addressOfHousehold + this.addressDetail
          this.$confirm('您确定要提交信息吗?', '提示', {
            confirmButtonText: '确定',
            cancelButtonText: '取消',
            type: 'warning'
          }).then(() => {
            request.post("/info_account/edit", this.information).then(res => {
              if (res.data.code === '200') {
                this.open()
              }
            })
          })
        }
      })
    },
    open() {
      this.$alert('提交成功', '提交成功', {
        confirmButtonText: '确定',
        showClose: false, //是否显示右上角的x
      }).then(()=>{
        let accountNo = "";
        if (router.currentRoute.value.query.accountNo === undefined) {
          accountNo = JSON.parse(localStorage.getItem('user')).accountNo
        } else {
          accountNo = router.currentRoute.value.query.accountNo
        }
        request.get("/info_account/getByAccountNo?accountNo=" + accountNo).then(res => {
          this.information = res.data.data
          this.detailedInformation = true
          window.getTemplateData = (callback) => {
            this.getTemplateData(callback);
          }
        })
      });
    },
    getTemplateData(callback) {
      callback(this.information);
    }, //获取文书数据
    getOneMassage(accountNo) {
      if (accountNo !== undefined) {
        // 获取用户信息
        request.get("/info_account/getByAccountNo?accountNo=" + accountNo).then(res => {
          if (res.data.code === '200') {
            this.information = res.data.data
            this.nativePlace = this.information.nativePlaceProvince + this.information.nativePlaceArea
          }
        })
      } else {
        request.get("/info_account/getByAccountNo?accountNo=" + this.accountNo).then(res => {
          if (res.data.code === '200') {
            this.information = res.data.data
            this.nativePlace = this.information.nativePlaceProvince + this.information.nativePlaceArea
          }
        })
      }
    },
    goBack() {
      this.information = {};
      this.id = JSON.parse(localStorage.getItem('user')).accountNo
    },
    getPolstatus() {
      request.get("/info_polstatus/all").then(res => {
        if (res.data.code === '200') {
          this.polstatus = res.data.data
        }
      })
    },
    // 获取所有班级
    getClass() {
      request.get("/info_class/getClassNo").then(res => {
        this.allClassNo = res.data.data
      })
    },
    // 年级
    getGrade(){
      request.get("/info_grade/allGrade").then(res=>{
        this.grade.push(...res.data.data)
      })
    },
    // 专业
    getMajor(){
      request.get("/info_major/allMajor").then(res=>{
          this.major.push(...res.data.data)
      })
    },
    selectRegion() {
      this.information.nativePlaceProvince=this.nativePlace[0]
      this.information.nativePlaceArea=this.nativePlace[2]
      this.nativePlace=this.nativePlace[0]+this.nativePlace[2]
    },
    addressOfHouseholdChange(){
      let item = "";
      for (let key in this.information.addressOfHousehold) {
        item=item+this.information.addressOfHousehold[key]
      }
      this.information.addressOfHousehold=item
    },
    addressOfHouseholdDialog(){
      ElMessageBox.alert(this.information.addressOfHousehold,{
        title: '是否修改',
        showCancelButton: true,
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      }).then(() => {
        this.information.addressOfHousehold=null
      });
    },
    addressDetial(){
      ElMessageBox.alert(this.information.addressOfHousehold,{
        title: '是否继续完善地址',
        showCancelButton: true,
        confirmButtonText: '确定',
        cancelButtonText: '取消',
      });
    }
  }
}


</script>

<style scoped>
@media (max-width: 1500px) {
  table {
    width: 100%;
  }
  #addressDetail{
    width: 100%;
  }
  th:nth-child(odd) {
    display: inline-block;
    width: 35%;
  }

  th:nth-child(even) {
    display: inline-block;
    width: 65%;
  }

  th, table td {
    display: block;
    width: 100%;
  }

}
</style>
